package com.changgou.order.schedul;

import com.changgou.order.dao.RemindMapper;
import com.changgou.order.pojo.Remind;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.List;

/*****
 * @Author: 郭文亮
 * @Date: 2019/8/19 14:39
 * @Description: com.changgou.order.schedul
 ****/
@Component
public class Timing {

    @Autowired
    private RemindMapper remindMapper;

    @Scheduled(cron = "0 0 0 * * ?")
    public void RemindTiming(){
        List<Remind> reminds = remindMapper.selectAll();
        if (reminds!=null && reminds.size()>0) {
            remindMapper.modifyStatus();
        }
    }
}
